package ControlLayer;



import static org.junit.Assert.*;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;

/**
 * The test class ControlsTesting.
 *
 * @author  (your name)
 * @version (a version number or a date)
 */
public class ControlsTesting
{
    /**
     * Default constructor for test class ControlsTesting
     */
    public ControlsTesting()
    {
    }

    /**
     * Sets up the test fixture.
     *
     * Called before every test case method.
     */
    @Before
    public void setUp()
    {
    }

    /**
     * Tears down the test fixture.
     *
     * Called after every test case method.
     */
    @After
    public void tearDown()
    {
    }

    @Test
    public void TestPersonContr()
    {
        ControlLayer.PersonControls personCo1 = new ControlLayer.PersonControls();
        personCo1.createPerson("John", "Hobrovej", "9000", "Aalborg", "8986859878", "222222");
        personCo1.findPerson("222222");
        personCo1.updatePerson("", "Letvadvej", "", "", "", "222222");
        personCo1.createPerson("Petras", "sddaad", "2000", "Aalborg", "89635874123", "555555");
        personCo1.deletePerson("555555");
    }

    @Test
    public void TestDVDContr()
    {
        ControlLayer.DVDControls dVDContr1 = new ControlLayer.DVDControls();
        dVDContr1.createDVD("123456", "Malice in a wonderland", "High tomwer", "121212");
        dVDContr1.createCopy("123456", "123789", "121212", "100");
        dVDContr1.findDVD("123456");
        dVDContr1.returnResult();
        dVDContr1.sizeOfDVDList();
        dVDContr1.updateDVD("123456", "", "", "131212");
        dVDContr1.resultCreateCopy();
    }

    @Test
    public void TestAll()
    {
        ControlLayer.PersonControls personCo1 = new ControlLayer.PersonControls();
        ControlLayer.DVDControls dVDContr1 = new ControlLayer.DVDControls();
        ControlLayer.LoanControls loanCont1 = new ControlLayer.LoanControls();
        personCo1.createPerson("John", "Hobrovej", "9000", "Aalborg", "78965324895", "123456");
        dVDContr1.createDVD("123456", "Malice in a wonderland", "High tower", "2014");
        dVDContr1.createCopy("123456", "123789", "121212", "100");
        loanCont1.startLoan("147258", "121214", "10", "123456", "123789");
        loanCont1.findLoan("147258");
        loanCont1.finishLoan("147258");
    }
}



